package com.java.easyExcel;

import com.alibaba.excel.EasyExcel;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import org.joda.time.DateTime;

import javax.jws.Oneway;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;

public class ImportExcel {

    public static void main(String[] args) {
        //年份偏移
        Date date = new DateTime().plusYears(1).toDate();
        Date date1 = new DateTime().plusYears(2).toDate();
        Date date2 = new DateTime().plusYears(3).toDate();
        Date date3 = new DateTime().plusYears(4).toDate();
        Date date4 = new DateTime().plusYears(5).toDate();


        String year = new DateTime().plusYears(-1).toString("yyyy");
        //格式化年份并转成Date类型
        Date date5 = new DateTime(year).toDate();
        Date date6 = new DateTime().plusYears(-2).toDate();
        Date date7 = new DateTime().plusYears(-3).toDate();
        Date date8 = new DateTime().plusYears(-4).toDate();

        new DateTime().getYear();

        String nowStirng = new DateTime().toString("yyyy年mm月dd日");
        String dateStirng = new DateTime().toString("yyyy-mm-dd");
        //System.out.println(nowStirng+"|"+dateStirng);



        HashMap<String, Object> map = new HashMap<>();
        map.put("age",18);
        map.put("sex","男");
        map.put("adress","上海");
        map.put("hobby","冲浪");

        ArrayList<Object> list = new ArrayList<>();
        for(int i=0;i<10;i++){
            map.put("name","张三"+i);
            list.add(map);
        }

        String jsonString = JSONObject.toJSONString(map);
        System.out.println(jsonString);


//        for(Map.Entry<String, Object>entry : map.entrySet()){
//            System.out.println(entry.getKey());
//            System.out.println(entry.getValue());
//        }
        //key value转数组


    }
}
